//
// Created by Administrator on 2023-12-31
// 高精度计算--乘法 高精度X高精度
// OJ: https://www.luogu.com.cn/problem/P1303 通过
// OJ: https://oj.youdao.com/problem/327?from=problems 通过
// OJ: http://ybt.ssoier.cn:8088/problem_show.php?pid=1307 通过
//

/*
 * https://www.bilibili.com/video/BV1dG411G7eb/?spm_id_from=333.337.search-card.all.click&vd_source=f69fe937b6744667b35fadd0fa06ddd2
 * http://t.csdnimg.cn/bFll9
in:
1234512345123456
6543265432654321
out:
8077741954031330769346516853376
 */

#include <iostream>

using namespace std;

int main()
{
    // x: 被乘数 y:乘数
    string x = "123", y = "13"; //1599 无进位
//    x = "123", y = "14"; //1722 有进位
//    x = "5555", y = "55"; // 305525
    x = "99", y = "9"; // 891
//    cin >> x >> y;
    if (x == "0" || y == "0")
        cout << 0;
    else
    {
        int length = x.size() + y.size();
        int ret[length] = {0};
        int next = 0; // 进位
        for (int i = y.size() - 1; i >= 0; --i)
        {
            for (int j = x.size() - 1; j >= 0; --j)
            {
//            printf("%d X %d \n",y[i]-'0',x[j]-'0');
                int cur = (y[i] - '0') * (x[j] - '0');
                next = cur / 10;
                cur %= 10;
                ret[i + j + 1] += cur;
                //  还可能有进位 , 所以下边还要处理一次
                next += ret[i + j + 1] / 10;
                ret[i + j + 1] %= 10;
                ret[i + j] += next;
            }
        }
        bool zero=(ret[0]==0);
        for (int i = 0; i < length; ++i)
        {
            if(!zero)
                cout << ret[i];
            else
                zero=false;
        }
    }
//    cout << endl << stoi(x) * stoi(y);
    return 0;
}